<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>何为数据代理</title>
</head>
<body>
<script type="text/javascript">
  var obj = {x:100}
  var obj1 = {y:200}

  Object.defineProperty(obj1,"x",{

    get(){
      return obj.x
    },
    set(value){
      obj.x =value
    }
  })
</script>

</body>
</html>